Optimal. Leaf size=55 \[ \frac {b \cot (x)}{a^2}+\frac {\left (a^2+b^2\right ) \log (\sin (x))}{a^3}-\frac {\left (a^2+b^2\right ) \log (a \cos (x)+b \sin (x))}{a^3}-\frac {\csc ^2(x)}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.12, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {3103, 3767, 8, 3101, 3475, 3133} \[ \frac {\left (a^2+b^2\right ) \log (\sin (x))}{a^3}-\frac {\left (a^2+b^2\right ) \log (a \cos (x)+b \sin (x))}{a^3}+\frac {b \cot (x)}{a^2}-\frac {\csc ^2(x)}{2 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3101
Rule 3103
Rule 3133
Rule 3475
Rule 3767
Rubi steps
\begin {align*} \int \frac {\csc ^3(x)}{a \cos (x)+b \sin (x)} \, dx &=-\frac {\csc ^2(x)}{2 a}-\frac {b \int \csc ^2(x) \, dx}{a^2}+\frac {\left (a^2+b^2\right ) \int \frac {\csc (x)}{a \cos (x)+b \sin (x)} \, dx}{a^2}\\ &=-\frac {\csc ^2(x)}{2 a}+\frac {b \operatorname {Subst}(\int 1 \, dx,x,\cot (x))}{a^2}+\frac {\left (a^2+b^2\right ) \int \cot (x) \, dx}{a^3}-\frac {\left (a^2+b^2\right ) \int \frac {b \cos (x)-a \sin (x)}{a \cos (x)+b \sin (x)} \, dx}{a^3}\\ &=\frac {b \cot (x)}{a^2}-\frac {\csc ^2(x)}{2 a}+\frac {\left (a^2+b^2\right ) \log (\sin (x))}{a^3}-\frac {\left (a^2+b^2\right ) \log (a \cos (x)+b \sin (x))}{a^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.16, size = 48, normalized size = 0.87 \[ \frac {2 \left (a^2+b^2\right ) (\log (\sin (x))-\log (a \cos (x)+b \sin (x)))-a^2 \csc ^2(x)+2 a b \cot (x)}{2 a^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.43, size = 117, normalized size = 2.13 \[ -\frac {2 \, a b \cos \relax (x) \sin \relax (x) - a^{2} + {\left ({\left (a^{2} + b^{2}\right )} \cos \relax (x)^{2} - a^{2} - b^{2}\right )} \log \left (2 \, a b \cos \relax (x) \sin \relax (x) + {\left (a^{2} - b^{2}\right )} \cos \relax (x)^{2} + b^{2}\right ) - {\left ({\left (a^{2} + b^{2}\right )} \cos \relax (x)^{2} - a^{2} - b^{2}\right )} \log \left (-\frac {1}{4} \, \cos \relax (x)^{2} + \frac {1}{4}\right )}{2 \, {\left (a^{3} \cos \relax (x)^{2} - a^{3}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.19, size = 78, normalized size = 1.42 \[ \frac {{\left (a^{2} + b^{2}\right )} \log \left ({\left | \tan \relax (x) \right |}\right )}{a^{3}} - \frac {{\left (a^{2} b + b^{3}\right )} \log \left ({\left | b \tan \relax (x) + a \right |}\right )}{a^{3} b} - \frac {3 \, a^{2} \tan \relax (x)^{2} + 3 \, b^{2} \tan \relax (x)^{2} - 2 \, a b \tan \relax (x) + a^{2}}{2 \, a^{3} \tan \relax (x)^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 11.61, size = 64, normalized size = 1.16 \[ -\frac {\ln \left (a +b \tan \relax (x )\right )}{a}-\frac {\ln \left (a +b \tan \relax (x )\right ) b^{2}}{a^{3}}-\frac {1}{2 a \tan \relax (x )^{2}}+\frac {\ln \left (\tan \relax (x )\right )}{a}+\frac {\ln \left (\tan \relax (x )\right ) b^{2}}{a^{3}}+\frac {b}{a^{2} \tan \relax (x )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.32, size = 119, normalized size = 2.16 \[ -\frac {\frac {4 \, b \sin \relax (x)}{\cos \relax (x) + 1} + \frac {a \sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}}}{8 \, a^{2}} - \frac {{\left (a^{2} + b^{2}\right )} \log \left (-a - \frac {2 \, b \sin \relax (x)}{\cos \relax (x) + 1} + \frac {a \sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}}\right )}{a^{3}} + \frac {{\left (a^{2} + b^{2}\right )} \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1}\right )}{a^{3}} - \frac {{\left (a - \frac {4 \, b \sin \relax (x)}{\cos \relax (x) + 1}\right )} {\left (\cos \relax (x) + 1\right )}^{2}}{8 \, a^{2} \sin \relax (x)^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.57, size = 91, normalized size = 1.65 \[ \frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )\,\left (a^2+b^2\right )}{a^3}-\frac {\ln \left (-a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {x}{2}\right )+a\right )\,\left (a^2+b^2\right )}{a^3}-\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{8\,a}-\frac {b\,\mathrm {tan}\left (\frac {x}{2}\right )}{2\,a^2}-\frac {\frac {a}{2}-2\,b\,\mathrm {tan}\left (\frac {x}{2}\right )}{4\,a^2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\csc ^{3}{\relax (x )}}{a \cos {\relax (x )} + b \sin {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________